package com.chukun.flink.stream.kafka;

import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.kafka.common.serialization.Serializer;

import java.nio.charset.StandardCharsets;
import java.util.Map;

/**
 * @author chukun
 * @version 1.0.0
 * @description kafka消息序列化器
 * @createTime 2022年06月04日 11:55:00
 */
public class KafkaValueSerializerSchema implements Serializer<Tuple2<Integer, String>> {


    @Override
    public void configure(Map<String, ?> map, boolean b) {}

    @Override
    public byte[] serialize(String key, Tuple2<Integer, String> tuple) {
        return tuple.f1.getBytes(StandardCharsets.UTF_8);
    }

    @Override
    public void close() {}
}
